/* 
 * File:   FileCachedCleanProcessQuitHandler.cpp
 * Author: dell
 * 
 * Created on 2012年11月21日, 下午5:47
 */

#include "FileCachedCleanProcessQuitHandler.h"
#include "ServerPid.h"

namespace Rapid{
    FileCachedCleanProcessQuitHandler::FileCachedCleanProcessQuitHandler(std::string& hdir):homeDir(hdir) {
    }


    FileCachedCleanProcessQuitHandler::~FileCachedCleanProcessQuitHandler() {
    }

    
    bool FileCachedCleanProcessQuitHandler::onProcessSignalEvent(const ProcessSignalEvent* e){
        ServerPid serverPid(homeDir.c_str(), 0);
        serverPid.remove();
        
        exit(0);
        return true;
    }
    
    
    bool FileCachedCleanProcessQuitHandler::onTimerEvent(const TimerEvent* e){

        return true;
    }      
    
}


